<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.thymeleaf.org/extras/spring-security">
<head th:replace="common/head :: head"></head>
<style>
    .layui-form-select dl { max-height:200px; }
</style>
<body>

<div th:replace="common/header :: header"></div>

<div class="layui-container fly-marginTop">
  <div class="fly-panel" pad20 style="padding-top: 5px;">
    <!--<div class="fly-none">没有权限</div>-->
    <div class="layui-form layui-form-pane">
      <div class="layui-tab layui-tab-brief" lay-filter="user">
        <ul class="layui-tab-title">
          <li class="layui-this">发表新帖</li>
        </ul>
        <div class="layui-form layui-tab-content" id="LAY_ucm" style="padding: 20px 0;">
          <div class="layui-tab-item layui-show">
            <form method="post">
              <div class="layui-row layui-col-space15 layui-form-item">
                <div class="layui-col-md3">
                  <label class="layui-form-label">所在专栏</label>
                  <div class="layui-input-block">
                    <select lay-verify="required" name="columnType" lay-filter="column">
                      <option></option>
                      <option th:each="columnType : ${columnTypes}" th:object="${columnType}"
                              th:value="${columnType.name()}"
                              th:text="${columnType.describe}"
                              th:if="${#authorization.expression('hasAnyRole(#vars.columnType.roles)')}"
                      >提问</option>
                    </select>
                  </div>
                </div>
                <div id="LAY_quiz" class="layui-col-md3 layui-hide">
                  <label class="layui-form-label">技术类型</label>
                  <div class="layui-input-block">
                    <select lay-verify="required" id="technologyType" name="technologyType">
                      <option></option>
                      <option sec:authorize="hasRole('admin')" th:value="all"></option>
                      <option th:each="technologyType,iterStat : ${technologyTypes}"
                              th:value="${technologyType.name()}"
                              th:text="${technologyType.describe}"
                              th:if="${iterStat.index != 0}"
                              >JAVA</option>
                    </select>
                  </div>
                </div>
                <div class="layui-col-md9 title">
                  <label for="L_title" class="layui-form-label">标题</label>
                  <div class="layui-input-block">
                    <input type="text" id="L_title" name="jieTitle"  lay-verify="required|title" autocomplete="off" class="layui-input">
                  </div>
                </div>
              </div>

              <div class="layui-form-item layui-form-text">
                <div class="layui-input-block">
                  <textarea id="L_content" name="jieContent" required lay-verify="required" placeholder="详细描述" class="layui-textarea fly-editor" style="height: 260px;"></textarea>
                </div>
              </div>
              <div class="layui-form-item reward">
                <div class="layui-inline">
                  <label class="layui-form-label">悬赏</label>
                  <div class="layui-input-inline" style="width: 190px;">
                    <select name="rewardValue">
                      <option th:each="rewardvalue : ${rewardValues}"
                              th:value="${rewardvalue.name()}"
                              th:text="${rewardvalue.describe+'元气'}"
                      >20元气</option>
                    </select>
                  </div>
                  <div class="layui-form-mid layui-word-aux">
                    <span style="padding-right: 5px;">发表后无法更改元气</span>
                    <a th:href="@{https://www.chengliangyun.com/q/jie/79}" target="_blank" style="color: #FF5722;"><strong>(关于元气)</strong></a>
                  </div>

                </div>
              </div>
              <div class="layui-form-item">
                <label for="L_vercode" class="layui-form-label">验证码</label>
                <div class="layui-input-inline">
                  <input type="text" id="L_vercode" name="verCode" required lay-verify="required" placeholder="请回答后面的问题" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid">
                    <img th:src="@{/user/images/captcha.png}"  class="fly-imagecode">
                </div>
              </div>
              <div class="layui-form-item">
                <button class="layui-btn layui-btn-normal" lay-filter="*" flush-imagecode="1" alert="1" lay-submit>立即发布</button>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<div th:replace="common/footer :: footer"></div>
<script th:replace="common/common-js :: js"></script>
<script th:inline="javascript" >
  layui.config({
    base: '/res/mods/'
  }).extend({
    fly: 'index'
  }).use(['fly','jie']);
</script>
</body>
</html>